<template>
  <div class="withdrawalRecord">
			<div class="content">
					<div class="area">
            <p style="margin:10px;font-size:18px">提现记录</p>
					  <el-table :data="tableData" :center="true" style="width: 100%">
              <el-table-column prop="" label="财务类型" width="80">
                <template slot-scope="scope">
						      <span v-if="scope.row.accountType == 1">个人</span>
						      <span v-if="scope.row.accountType == 2">企业</span>
                </template>
              </el-table-column>
              <el-table-column prop="bankName" label="银行名称" width="">
              </el-table-column>
              <el-table-column prop="bankSubName" label="支行名称" width="">
              </el-table-column>
              <el-table-column prop="bankUserName" label="账户名"  width="100">
              </el-table-column>
              <el-table-column prop="bankNo" label="帐号">
              </el-table-column>
              <el-table-column prop="applyMoney" label="提现金额">
              </el-table-column>
              <el-table-column prop="applyTime" label="申请时间" width="100">
              </el-table-column>
              <el-table-column prop="" label="状态" width="120">
                <template slot-scope="scope">
                <span v-if="scope.row.status == 0" >已撤销</span>
                <span v-if="scope.row.status == 1" >申请</span>
                <span v-if="scope.row.status == 2" >已审核通过</span>
                <span v-if="scope.row.status == 3" >已确认通过</span>
              </template>
              </el-table-column>
            </el-table>
				</div>
        <div class="block" style="margin-left:38%">
          <el-pagination 
             @current-change="handleCurrentChange" 
            :current-page.sync="currentPage" 
            :page-size="10" 
            layout="total, prev, pager, next" :total="this.total">
          </el-pagination>
        </div>
			</div>
  </div>
</template>
<script>
import commonJs from "@/common/js/common";
export default {
  name: "withdrawalRecord",
  data() {
    return {
      tableData: [],
      total: 0,
      currentPage: 1,
      page: 1,
      rows: 10
    };
  },
  mounted() {
    this.devId = localStorage.getItem("devId");
    this.token = localStorage.getItem("token");
    this.withdrawalPagelist();
  },
  methods: {
    // 12. 提现列表
    withdrawalPagelist() {
      this.$http({
        method: "POST",
        url: commonJs.BASE_URL + "/withdrawal/pagelist.do",
        data: `devId=${this.devId}&token=${this.token}&page=${this.page}&rows=${
          this.rows
        }`
      }).then(res => {
        if (res.data.code == 0) {
          this.tableData = res.data.data.list;
          this.total = res.data.data.total;
        }
      });
    },
    //分页
    handleCurrentChange(val) {
      this.page = val;
      this.withdrawalPagelist();
    }
  }
};
</script>
<style>

</style>

<style scoped>
.withdrawalRecord {
  /* height: 100%; */
}
.main .content {
  width: 90%;
  margin: 20px auto;
}
.withdrawalRecord .area {
  border: 1px solid #ebebeb;
  padding: 20px;
  height: 550px;
  margin-bottom: 20px;
  position: relative;
  overflow-y: auto;
}
.withdrawalRecord .el-table tr td .cell {
  text-align: center !important;
  background: red !important;
}
</style>
